package com.joint.core.service.impl;

import com.joint.base.dao.BaseEntityDao;
import com.joint.base.service.impl.BaseEntityServiceImpl;
import com.joint.core.bean.PublicEnum;
import com.joint.core.dao.DictionaryDao;
import com.joint.core.entity.Dictionary;
import com.joint.core.service.DictionaryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by dqf on 2015/8/20.
 */
@Service
public class DictionaryServiceImpl extends BaseEntityServiceImpl<Dictionary, String> implements DictionaryService {
    @Resource
    private DictionaryDao dictionaryDao;

    @Override
    public BaseEntityDao<Dictionary, String> getBaseEntityDao() {
        return dictionaryDao;
    }

    @Override
    public List<Dictionary> findByTypeAll(PublicEnum.DictionaryEnm type) {
        return dictionaryDao.findByTypeAll(type);
    }

    @Override
    public List<Dictionary> findByType(PublicEnum.DictionaryEnm type, boolean isClosed) {
        return dictionaryDao.findByType(type,isClosed);
    }

    @Override
    public List<Dictionary> findChildAll(Dictionary dict) {
        return dictionaryDao.findChildAll(dict);
    }

    @Override
    public List<Dictionary> findChildByState(Dictionary dict, boolean isClosed) {
        return dictionaryDao.findChildByState(dict, isClosed);
    }
}
